<template>
  <NuxtLayout>
    <NuxtPage />
  </NuxtLayout>
</template>
<script lang="ts" setup>
import { commonStore } from "@/components/store";

const store = commonStore();
type Tseo = {
  headTag: string;
  keyword: string;
  mainKeyword: string;
  meta: string;
};
type Tpage = {
  name: string;
  seoDTO: Tseo;
  property: {
    certifications: string[];
    currency: string;
    footer: {
      icp: string;
      phone: string;
      email: string;
    }
  }
};
const getPage = async () => {
  const { data } = await useServerFetch<Tpage>("/app-api/promotion/diy-page/getByCode", {
    method: "get",
    query: {
      code: 'common',
    },
  });
  if (data.property?.footer) {
    store.footerData = data.property.footer;
    store.currency = data.property.currency;
    store.certifications = data.property.certifications;
  }
};

onMounted(() => {
  getPage();
});
</script>
